package com.meilele.biz.hongdian;

import com.meilele.dao.hongdian.*;
import com.meilele.entity.hongdian.*;
import com.meilele.util.hongdian.Constant;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class ThiCaseManagerBiz {

    @Resource
    private ThiCaseMapper caseMapper;
    @Resource
    private ThiCaseLableMapper caseLableMapper;
    @Resource
    private ThiImagesMapper imagesMapper;
    @Resource
    private ThiShowMapper showMapper;
    @Resource
    private ThiLablesMapper lablesMapper;

    public List<ThiCase> findAllCaseManager(int page){
        int firstPage = (page - 1) * Constant.PAGE_SIZE_MANAGER;
        return caseMapper.findAllCaseManager(firstPage, Constant.PAGE_SIZE_MANAGER);
    }

    public void saveCase(ThiCase thiCase){
        caseMapper.saveCase(thiCase);
    }

    public void saveCaseLable(ThiCaseLable caseLable){
        caseLableMapper.saveCaseLable(caseLable);
    }

    public int insertSelective(ThiImages images){
        return imagesMapper.insertSelective(images);
    }

    public ThiCaseLable findLableById(int id){
        return caseLableMapper.findLableById(id);
    }

    public int insertSelective(ThiShow thiShow){
        return showMapper.insertSelective(thiShow);
    }

    public int insertSelective(ThiLables thiLables){
        return lablesMapper.insertSelective(thiLables);
    }

    public ThiCase findCaseById(int caseId){
        return caseMapper.findCaseById(caseId);
    }

    public List<ThiLables> findLablesId(int caseId){
        return lablesMapper.findLablesId(caseId);
    }

    public ThiCaseLable findLablesById(int lableId){
        return caseLableMapper.findLablesById(lableId);
    }

    public ThiShow findShowById(int showId){
        return showMapper.findShowById(showId);
    }

    public int deleteLables(int caseId){
        return lablesMapper.deleteLables(caseId);
    }

    public int deleteShow(int showId){
        return showMapper.deleteShow(showId);
    }

    public int deleteImages(int showId){
        return imagesMapper.deleteImages(showId);
    }

    public int deleteCase(int caseId){
        return caseMapper.deleteCase(caseId);
    }

    public int updateByPrimaryKeySelective(ThiShow thiShow){
        return showMapper.updateByPrimaryKeySelective(thiShow);
    }

    public int updateByPrimaryKeySelective(ThiCase thiCase){
        return caseMapper.updateByPrimaryKeySelective(thiCase);
    }
}
